package com.zretc.entity;

import java.io.Serializable;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * 自定义实体类
 * 
 * @author admin
 *
 */
public class Users implements Serializable, InitializingBean, DisposableBean,BeanNameAware,BeanFactoryAware {

	private int userid;
	private String username;
	private int userage;
	
	@Override
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		// TODO Auto-generated method stub
		System.out.println("setBeanFactory :"+beanFactory);
	}
	
	@Override
	public void setBeanName(String name) {
		// TODO Auto-generated method stub
		System.out.println("setBeanName "+name);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("afterPropertiesSet");
	}

	@Override
	public void destroy() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("DisposableBean");
	}

	public void init() {
		System.out.println("init..........");
	}

	public void objdestory() {
		System.out.println("destroy.........");
	}

	@Override
	public String toString() {
		return "Users [userid=" + userid + ", username=" + username + ", userage=" + userage + "]";
	}

	public Users() {
		System.out.println("Users无参数构造");
	}

	public Users(int userid, String username, int userage) {
		super();
		this.userid = userid;
		this.username = username;
		this.userage = userage;
		System.out.println("Users带参数构造");
	}

	/**
	 * @return the userid
	 */
	public int getUserid() {
		return userid;
	}

	/**
	 * @param userid the userid to set
	 */
	public void setUserid(int userid) {
		System.out.println("setId :" + userid);
		this.userid = userid;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the userage
	 */
	public int getUserage() {
		return userage;
	}

	/**
	 * @param userage the userage to set
	 */
	public void setUserage(int userage) {
		this.userage = userage;
	}

}
